{include file='header.tpl'}
{include file='admin/leftcol.tpl'}
<div id="left-area">

              <div class="breadcrumb">
            <span class="raquo"></span><a href="/">Главная</a>
           <span class="raquo"> &raquo; </span><a href="{geturl controller="admin" action="index"}">Админ панель</a>  
           <span class="raquo"> &raquo; </span><a href="{geturl controller='admin' action='products'}">Продукты</a>  
    </div>
    <div class="related-items clearfix" style="padding: 17px 0 35px;">
    <h1 class="category-title">Продукты</h1> 
      <div class="product-filter">
       
        <div class="sort">Сортировка:      <select onchange="location = this.value;">
                <option value="?sort=p.date_add&amp;order=DESC{if $type}&type={$type}{/if}" {if $sort=='p.date_add' && $order=='DESC'}selected="selected"{/if}>По умолчанию</option>
                <option value="?sort=p.price&amp;order=ASC{if $type}&type={$type}{/if}" {if $sort=='p.price' && $order=='ASC'}selected="selected"{/if}>Цена (по возрастанию)</option>
                <option value="?sort=p.price&amp;order=DESC{if $type}&type={$type}{/if}" {if $sort=='p.price' && $order=='DESC'}selected="selected"{/if}>Цена (по убыванию)</option>
                <option value="?sort=p.date_add&amp;order=ASC{if $type}&type={$type}{/if}" {if $sort=='p.date_add' && $order=='ASC'}selected="selected"{/if}>Дата добавления (по возрастанию)</option>
                <option value="?sort=p.date_add&amp;order=DESC{if $type}&type={$type}{/if}" {if $sort=='p.date_add' && $order=='DESC'}selected="selected"{/if}>Дата добавления (по убыванию)</option>
            </select>
        </div>
         <div class="type">На странице:      <select onchange="location = this.value;">
                <option value="" >Все работы</option>
                <option value="?type=1" {if $type=='1'}selected{/if}>Готовые работы</option>
                <option value="?type=2" {if $type=='2'}selected{/if}>На заказ</option>
                <option value="?type=3" {if $type=='3'}selected{/if}>Для примера</option>
            
            </select>
        </div>
    </div>
    {foreach from=$products item=d}
        <div class="main-product">
            <a href="{getsuburl route='shopproduct' name=$d->nameshop action='item' id=$d->getId()}" id="name_{$d->getId()}">
               <img class="img" src="{$d->logo}" alt="{$d->name}" style="width:137px;height:121px;">
                <span class="price-tag"><span><span class="currency">{$currency}</span></span>								 
                    {$d->price}        </span>
                                           
            </a>
            <h4 class="title">
                <a href="{getsuburl route='shopproduct' name=$d->nameshop action='item' id=$d->getId()}" id="name_{$d->getId()}">{$d->name}</a>
            </h4>
            <div class="et-links clearfix">
               <a href="{geturl route='admineditproducts' id=$d->getId()}" class="add-to-cart et-shop-item">Изменить</a>
                <a href="javascript:void();" onclick="deleteproducts({$d->getId()})" id="name_{$d->getId()}" class="more-info">Удалить</a>
            </div> <!-- end .et-links -->
         

        </div>
    {/foreach} 
</div>




{if $pages->count_pages > 1}
<div class="wp-pagenavi">
<span class="pages">Страница {$p} из {$pages->count_pages}</span> 
<!-- Previous page link -->
 <a href="{geturl controller="admin" action="products"}{if $type}?type={$type}{if $cat}&cat={$cat}{/if}{else}{if $cat}?cat={$cat}{/if}{/if}" class="last">«Первая</a> 
{if $pages->active > '1' }
<a href="{geturl controller="admin" action="products"}?p={$pages->active-1}{if $cat}&cat={$cat}{/if}{if $type}&type={$type}{/if}" >«</a> 
{/if}
<!-- Numbered page links -->
{section name=foo start=$pages->start loop=$pages->end step=1}

{if $smarty.section.foo.index != $pages->active }
<a href="{geturl controller="admin" action="products"}?p={$smarty.section.foo.index}{if $cat}&cat={$cat}{/if}{if $type}&type={$type}{/if}" class="page smaller">{$smarty.section.foo.index}</a> 
{else}
 <span class="current">{$smarty.section.foo.index}</span>
{/if}
{/section}
<!-- Next page link -->
{if $pages->active < $pages->count_pages}
<a href="{geturl controller="admin" action="products"}?p={$pages->active+1}{if $cat}&cat={$cat}{/if}{if $type}&type={$type}{/if}" class="nextpostslink">»</a>
 {/if}
 <a href="{geturl controller="admin" action="products"}?p={$pages->count_pages}{if $cat}&cat={$cat}{/if}{if $type}&type={$type}{/if}" class="last">Последняя»</a> 
 </div>
 {/if}
<div class="botline"></div>
</div>
{include file="footer.tpl"}
 



